<script setup lang="ts">
import { showToast } from 'vant'
import { useUniStore } from '@/store/modules/uni'

defineOptions({
  name: 'Home',
})
const router = useRouter()
const uniStore = useUniStore()

function scanCode() {
  uniStore.scanCode()
}
</script>

<template>
  <div>
    <van-button type="primary" @click="router.push('/goods')">
      商品
    </van-button><br><br>
    <van-button type="success" @click="router.push('/my')">
      我的
    </van-button><br><br>
    <van-button type="default" @click="scanCode">
      扫码测试
    </van-button><br><br>
    <van-button type="default" @click="showToast('默认按钮')">
      默认toast
    </van-button><br><br>
    <van-button
      type="warning" @click="showToast({
        type: 'fail',
        message: '警告按钮',
      })"
    >
      警告toast
    </van-button><br><br>
    <van-button
      @click="showToast({
        type: 'loading',
        message: '正在加载...',
      })"
    >
      加载中toast
    </van-button><br><br>
    <van-button type="default" @click="showToast('默认按钮')">
      默认toast
    </van-button><br><br>
    <van-button
      type="warning" @click="showToast({
        type: 'fail',
        message: '警告按钮',
      })"
    >
      警告toast
    </van-button><br><br>
    <van-button
      @click="showToast({
        type: 'loading',
        message: '正在加载...',
      })"
    >
      加载中toast
    </van-button><br><br>
    <van-button type="default" @click="showToast('默认按钮')">
      默认toast
    </van-button><br><br>
    <van-button
      type="warning" @click="showToast({
        type: 'fail',
        message: '警告按钮',
      })"
    >
      警告toast
    </van-button><br><br>
    <van-button
      @click="showToast({
        type: 'loading',
        message: '正在加载...',
      })"
    >
      加载中toast
    </van-button><br><br>
  </div>
</template>

<style lang="less" scoped>
</style>
